package org;

import java.lang.management.ManagementFactory;

import javax.management.MBeanServer;
import javax.management.ObjectName;

public class TMonitoringAgent {

    private MBeanServer server = null;

    public TMonitoringAgent() {

        server = ManagementFactory.getPlatformMBeanServer();

        TMonitoring tBean = new TMonitoring();
        ObjectName tBeanName = null;

        try {
            tBeanName = new ObjectName("TMonitoringAgent:type=TMonitoring");
            server.registerMBean(tBean, tBeanName);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
